Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate additional_properties when using #[serde(flatten)] #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nightkr
Copy link
Contributor

@nightkr nightkr commented Mar 22, 2024

Fixes #259, motivated by stackabletech/operator-rs#752

Whether None or Some(Schema::Object(...)) is more permissive is arguably a matter of perspective. If you consider the JSON Schema to be a a validation target then None could be argued to mean "and I don't care about anything else", while if it's a normative schema then None would mean "and nothing else is accepted".

Following the latter interpretation, any non-None schema would be more permissive than None.

I also believe that the expected behaviour is always that a "newtype" (a single flattened field) behaves identically to the type that it wraps, modulo explicitly requested differences.

@nightkr
Copy link
Contributor Author

nightkr commented Mar 22, 2024

The MSRV check seems to be unrelated, and comes from rust-lang/cargo#9930.

@nightkr
Copy link
Contributor Author

nightkr commented Mar 22, 2024

RUSTC_BOOTSTRAP=1 cargo +1.60.0 test -Z minimal-versions passes locally for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schemars omit serde(flatten) BTreeMap
1 participant